package pers.zh.parking.service;

import ch.qos.logback.core.util.TimeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pers.zh.parking.dao.NoticeMapper;
import pers.zh.parking.po.Notice;
import pers.zh.parking.po.NoticeExample;

import java.util.Date;
import java.util.List;

@Service
public class NoticeService implements INoticeService {

    @Autowired
    NoticeMapper noticeMapper;

    @Override
    public List<Notice> getAll() {
        return noticeMapper.selectByExample(new NoticeExample());
    }

    @Override
    public boolean add(Notice notice) {
        return noticeMapper.insertSelective(notice) > 0;
    }

    @Override
    public boolean updte(Notice notice) {
        return noticeMapper.updateByPrimaryKeySelective(notice) > 0;
    }

    @Override
    public boolean delete(List<Notice> list) {
        return noticeMapper.batchDelete(list) > 0;
    }
}
